package com.yuwei.mine.adapter

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.yuwei.database.entity.GoodsEntityItem
import com.yuwei.image.glide.GlideImageLoader
import com.yuwei.mine.R

class HistoryAdapter: BaseQuickAdapter<GoodsEntityItem, BaseViewHolder>(
    R.layout.item_history
) {
    override fun convert(holder: BaseViewHolder, item: GoodsEntityItem) {
        holder.setText(R.id.item_history_goods_price,"￥${item.goods_default_price}")
        holder.setText(R.id.item_history_goods_desc,item.goods_desc)
        holder.setText(R.id.item_history_goods_sales,"已售：${item.goods_sales_count}")
        val image = holder.getView<ImageView>(R.id.item_history_goods_image)
        GlideImageLoader.loadImage(image.context,image,item.goods_default_icon)
    }
}